<%--
  Created by IntelliJ IDEA.
  User: zth
  Date: 2022/10/13
  Time: 16:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript" src="static/jquery-3.6.0.js"></script>
</head>
<body>
<form>
   用户： <input type="text" name="username" id="username" onblur="checkUsername(this)"><br>
    密码：<input type="password" name="password"><br>
    <input type="button" value="提交"  onclick="subuser()">
</form>
<script>
   function checkUsername(obj) {
       let nnn = $("#username").val();
       $.ajax({
           type:"post",
           url:"checkUsername",
           data:{name:nnn},
           success:function (d) {
            if (d==1){
                alert("不能注册");
            }else {
                alert("可以注册")
            }
           }

       })
   }

</script>

</body>
</html>
